package com.android.tripspins.app;

import android.app.Application;
import android.content.Context;

import com.android.tripspins.app.bo.User;
import com.facebook.model.GraphUser;

import java.util.List;

/**
 * Created by João.Rutkoski on 10/02/14.
 */
public class GlobalState extends Application {

    private GraphUser loggedFacebookUser;
    private User loggedLocalUser;
    private static GlobalState globalState;

    public static GlobalState getInstance()
    {
        return globalState;
    }
    public static Context getContext(){
        return globalState.getApplicationContext();
    }

    private List<GraphUser> selectedUsers;

    public List<GraphUser> getSelectedUsers() {
        return selectedUsers;
    }

    public void setSelectedUsers(List<GraphUser> users) {
        selectedUsers = users;
    }

    public User getLoggedLocalUser() {
        return loggedLocalUser;
    }

    public void setLoggedLocalUser(User loggedLocalUser) {
        this.loggedLocalUser = loggedLocalUser;
    }

    public GraphUser getLoggedFacebookUser() {
        return loggedFacebookUser;
    }

    public void setLoggedFacebookUser(GraphUser loggedFacebookUser) {
        this.loggedFacebookUser = loggedFacebookUser;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        globalState = this;
    }
}
